/* 全局样式 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #34495e;
    --success-color: #28a745;
    --error-color: #dc3545;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --border-color: #e1e5e9;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-start: #4a90e2;
    --gradient-end: #357abd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 容器样式 */
.container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px var(--shadow-color);
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header .icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.header h1 {
    font-size: 32px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 16px;
}

/* 输入区域样式 */
.input-section {
    margin-bottom: 40px;
}

.input-group {
    position: relative;
    display: flex;
    gap: 10px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    transition: transform 0.3s ease;
}

.input-icon {
    color: #666;
    font-size: 20px;
    margin: auto 0;
}

input[type="url"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 16px;
    color: var(--text-color);
}

.generate-btn {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.input-hint {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* 结果区域样式 */
.result-section {
    display: none;
    margin-top: 40px;
    text-align: center;
}

.result-section.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.qr-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-color);
    margin-bottom: 20px;
}

#qrcode {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 10px;
}

#qrcode img {
    display: block;
    margin: 0 auto;
}

.qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.action-btn:not(.secondary) {
    background: var(--primary-color);
    color: white;
}

.action-btn.secondary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.url-display {
    margin-top: 20px;
    padding: 15px;
    background: var(--background-color);
    border-radius: 8px;
    word-break: break-all;
}

/* 特性区域样式 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 60px;
    text-align: center;
}

.feature {
    padding: 20px;
}

.feature i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.feature p {
    color: #666;
    font-size: 14px;
}

/* 消息提示样式 */
.success-message,
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.success-message {
    background: var(--success-color);
}

.error-message {
    background: var(--error-color);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 加载动画 */
.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .generate-btn {
        width: 100%;
        justify-content: center;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --text-color: #ffffff;
        --border-color: #333333;
        --shadow-color: rgba(0, 0, 0, 0.3);
    }

    .container,
    .input-group,
    input[type="url"],
    .qr-container {
        background: #2d2d2d;
    }

    .header h1,
    .feature h3 {
        color: #ffffff;
    }

    .header p,
    .input-hint,
    .feature p {
        color: #999999;
    }
} 